using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using KPIS.GERP.Models.Class;

namespace KPIS.GERP.Models.ICM
{
    [DataContract, Table("IcmReceive")]
    [KnownType(typeof(Models.ICM.Received))]
    public class Received
    {
        public Received()
        {
        }

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "ReceiveId", ResourceType = typeof(Resources.ReceiveResource))]
        public int ReceiveId { get; set; }

        [DataMember, Display(Name = "ReceiveCode", ResourceType = typeof(Resources.ReceiveResource))]
        public string ReceiveCode { get; set; }

        [CustomRequired]
        [DataMember, Display(Name = "ReceiveName", ResourceType = typeof(Resources.ReceiveResource))]
        public string ReceiveName { get; set; }

        [CustomRequired]
        [ForeignKey("ReceiveType")]
        [DataMember, Display(Name = "ReceiveTypeId", ResourceType = typeof(Resources.ReceiveResource))]
        public int ReceiveTypeId { get; set; }

        [DataMember, Display(Name = "ReceiveDate", ResourceType = typeof(Resources.ReceiveResource))]
        [Column(TypeName="datetime2")]
        public DateTime ReceiveDate { get; set; }

        [ForeignKey("DeliveryNote")]
        [DataMember, Display(Name = "DeliveryNoteId", ResourceType = typeof(Resources.ReceiveResource))]
        public int? DnId { get; set; }

        [CustomRequired]
        [ForeignKey("Warehouse")]
        [DataMember, Display(Name = "WhId", ResourceType = typeof(Resources.ReceiveResource))]
        public int WhId { get; set; }

        [DataMember, Display(Name = "RefNo", ResourceType = typeof(Resources.ReceiveResource))]
        public string RefNo { get; set; }

        [DataMember, Display(Name = "Remark", ResourceType = typeof(Resources.ReceiveResource))]
        public string Remark { get; set; }

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.ReceiveResource))]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.ReceiveResource))]
        public int CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.ReceiveResource))]
        public DateTime? CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.ReceiveResource))]
        public int? UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.ReceiveResource))]
        public DateTime? UpdatedWhen { get; set; }
		 
        [DataMember]
        public virtual Warehouse Warehouse { get; set; }

        [DataMember]
        public virtual DeliveryNote DeliveryNote { get; set; }

        [DataMember]
        public virtual IcmMasLookUp ReceiveType { get; set; }

    }
}
